package com.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public enum Day {
	day1(1, 1), day2(2, 2), day3(3, 3), day4(4, 4), day5(5,
			5), day6(6, 6), day7(7, 7), day8(8, 8), day9(9,
			9), day10(10, 10), day11(11, 11), day12(12, 12), day13(
			13, 13), day14(14, 14), day15(15, 15), day16(16, 16), day17(
			17, 17), day18(18, 18), day19(19, 19), day20(20, 20), day21(
			21, 21), day22(22, 22), day23(23, 23), day24(24, 24), day25(
			25, 25), day26(26, 26),day27(27, 27), day28(28, 28), day29(
			29, 29), day30(30, 30), day31(31,31);

	private int dayId;

	private int dayName;

	private static Map<Integer, Day> constantsMap; 

	private static List<Day> dayList; 

	static {
		constantsMap = new HashMap<Integer, Day>();
		dayList = new ArrayList<Day>();
		for (Day c : Day.values()) {
			dayList.add(c);
			constantsMap.put(c.dayId, c);
		}
	}

	
	public static Day getdayById(Integer dayId) {
		return constantsMap.get(dayId);
	}

		public static int getdayNameById(Integer dayId) {
		return constantsMap.get(dayId).getdayName();
	}

	
	Day(int dayId, int dayName) {
		this.dayId = dayId;
		this.dayName = dayName;
	}

	public int getdayId() {
		return dayId;
	}

	public int getdayName() {
		return dayName;
	}

	
	public static List<Day> getdayList() {
		return dayList;
	}


}
